<template>
  <div class="App">
    <h1 class="content">我是App</h1>
      <div>
      <p v-red>自定义指令test1</p>
      <p v-red>自定义指令test2</p>
      <p v-bgColor="'green'">自定义指令test3</p>
      <p v-bgColor="'blue'">自定义指令test4</p>
      </div>
    <Cont />
   </div>
</template>

<script>
import Cont from '@/components/Cont';

export default {
  name: 'App',
  components: {
    Cont,
  },
  directives:{
    red(el){
      console.log("el.parentNode",el.parentNode);
      el.style.background="red";
    },
    bgColor(el,binding){
      el.style.background= binding.value;
    }
  },

}
</script>


